"""NewsRequests URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin

from api import register, login, guonei_data, guoji_data, junshi_data, caijing_data, yule_data, tiyu_data, search_data, \
    look_get, recommend_data
from api.requests_message import guonei_message, guoji_message, junshi_message, caijing_message, yule_message, \
    tiyu_message, search_message
from api.route import href_index, href_login, href_register, href_guonei, href_guoji, href_junshi, href_caijing, \
    href_yule, href_tiyu, href_update, href_search, href_recommend

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    # 首页
    url('^$', href_index.Index.as_view()),

    # 登录跳转
    url('login/$', href_login.Login.as_view()),
    # 注册跳转
    url('register/$', href_register.Register.as_view()),
    # 注册接口
    url('register/create/$', register.Register.as_view()),
    # 登录接口
    url('login/auth/$', login.Login.as_view()),

    # 国内新闻跳转
    url("href/guonei/$", href_guonei.GuoNei.as_view()),
    # 国内新闻爬取
    url("get/guonei/data/$", guonei_message.GuoNeiRequests.as_view()),
    # 国内新闻显示
    url("guonei/show/", guonei_data.GuoNei.as_view()),

    # 国际新闻跳转
    url("href/guoji/$", href_guoji.GuoJi.as_view()),
    # 国际新闻爬取
    url("get/guoji/data/$", guoji_message.GuoJiRequests.as_view()),
    # 国际新闻显示
    url("guoji/show/", guoji_data.GuoJi.as_view()),

    # 军事新闻跳转
    url("href/junshi/$", href_junshi.JunShi.as_view()),
    # 军事新闻爬取
    url("get/junshi/data/$", junshi_message.JunShiRequests.as_view()),
    # 军事新闻显示
    url("junshi/show/", junshi_data.JunShi.as_view()),

    #  财经新闻跳转
    url("href/caijing/$", href_caijing.CaiJing.as_view()),
    #  财经新闻爬取
    url("get/caijing/data/$", caijing_message.CaiJingRequests.as_view()),
    #  财经新闻显示
    url("caijing/show/", caijing_data.CaiJing.as_view()),

    #  娱乐新闻跳转
    url("href/yule/$", href_yule.YuLe.as_view()),
    #  娱乐新闻爬取
    url("get/yule/data/$", yule_message.YuLeRequests.as_view()),
    #  娱乐新闻显示
    url("yule/show/", yule_data.YuLe.as_view()),

    #  体育新闻跳转
    url("href/tiyu/$", href_tiyu.TiYu.as_view()),
    #  体育新闻爬取
    url("get/tiyu/data/$", tiyu_message.TiYuRequests.as_view()),
    #  体育新闻显示
    url("tiyu/show/", tiyu_data.TiYu.as_view()),

    #  搜索新闻跳转
    url("href/search/$", href_search.Search.as_view()),
    #  搜索新闻爬取
    url("get/search/data/$", search_message.SearchRequests.as_view()),
    #  搜索新闻显示
    url("search/show/", search_data.Search.as_view()),

    #  推荐新闻跳转
    url("href/recommend/$", href_recommend.recommend.as_view()),
    #  新闻显示
    url("recommend/show/", recommend_data.Recommend.as_view()),

    #  记录浏览
    url("look/get/", look_get.LookGet.as_view()),
    # 更新接口
    url('update/$', href_update.Update.as_view()),
]
